
#include <iostream>
using namespace std;

#include <string.h>

bool Findfavorite(char phrase[], char word[]);

int main() {
    char word[15];
    char phrase[80];
    char answer[5];

    do {
        cout << "请输入你最喜欢的单词: ";
        cin.getline(word, 15);

        cout << "请输入一句话或者一个短语: ";
        cin.getline(phrase, 80);

        if (Findfavorite(phrase, word)) {
            cout << "找到了. 找到单词 " << word << "\n";
        }
        else {
            cout << "未找到单词 " << word << "\n";
        }

        cout << "继续吗? 输入yes或者no: ";
        cin.getline(answer, 5);
    } while (strcmp(answer, "yes") == 0);
}

bool Findfavorite(char phrase[], char word[]) {
    return NULL != strstr(phrase, word);
}
